<template>
	<view class="my-container">
		<view class="head">
			<image src="../../static/logo.png"></image>
			<text class="username">Geng</text>
			<view class="panel">
				<view class="panel_item">
					<text>5</text>
					<text>收藏的店铺</text>
				</view>
				<view class="panel_item">
					<text>5</text>
					<text>收藏的商品</text>
				</view>
				<view class="panel_item">
					<text>5</text>
					<text>关注的商品</text>
				</view>
				<view class="panel_item">
					<text>5</text>
					<text>足迹</text>
				</view>
			</view>
		</view>
		<uni-card title="我的订单">
			<view class="footer-box">
				<view class="footer-box-item">
					<image src="../../static/my-icons/icon1.png"></image>
					<text>待付款</text>
				</view>
				<view class="footer-box-item">
					<image src="../../static/my-icons/icon2.png"></image>
					<text>待收货</text>
				</view>
				<view class="footer-box-item">
					<image src="../../static/my-icons/icon1.png"></image>
					<text>退款/退货</text>
				</view>
				<view class="footer-box-item">
					<image src="../../static/my-icons/icon2.png"></image>
					<text>全部订单</text>
				</view>
			</view>
		</uni-card>
		<uni-list>
			<uni-list-item title="收货地址" link to="/subpkg/my-address/my-address"></uni-list-item>
			<uni-list-item title="联系客服" link to="/subpkg/my-address/my-address"></uni-list-item>
			<uni-list-item title="退出登录" clickable @click="logout"></uni-list-item>

		</uni-list>
	</view>
</template>

<script>
	import { mapMutations, mapState } from "vuex"
	export default {
		name: "my-info",
		data() {
			return {

			};
		},
		computed: {
			...mapState('m_user', ['redirectInfo'])
		},
		methods: {
			...mapMutations('m_user', ['setUserInfo', 'updateRedirectInfo']),
			logout() {
				var that = this
				uni.showModal({
					title: '提示',
					content: '确认退出吗',
					success: function (res) {
						if (res.confirm) {
							that.setUserInfo({})
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				})
			},
			
	},
}
</script>

<style lang="scss">
	.my-container {
		background-color: #f3f4f1;
	}

	.head {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		position: relative;
		height: 480rpx;
		background-color: #c00000;
		margin-bottom: 90rpx;

		image {
			width: 80px;
			height: 80px;
			border-radius: 50%;
		}

		.username {
			color: #fff;
			padding: 15px;
		}

		.panel {
			position: absolute;
			bottom: -80rpx;
			box-sizing: border-box;
			display: flex;
			justify-content: space-around;
			background-color: #fff;
			border-radius: 5px;
			margin: 0 11px;
			padding: 10px;
			z-index: 10;

			.panel_item {
				display: flex;
				width: 164rpx;
				flex-direction: column;
				align-content: center;

				text {
					text-align: center;
					font-size: 14px;
					padding: 3px;
				}
			}
		}
	}

	uni-card {
		.footer-box {
			display: flex;

			.footer-box-item {
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				image {
					width: 70rpx;
					height: 70rpx;
				}

				text {
					font-size: 14px;
					padding: 5px 0
				}
			}
		}
	}
</style>
